﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Discussions.master" AutoEventWireup="false" CodeFile="DiscussionDetails.aspx.vb" Inherits="DiscussionDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <fieldset>
<legend><label>Discussion Topic</label></legend>
    <asp:DetailsView ID="DVDiscussions" runat="server" Height="50px" Width="380px" 
        AutoGenerateRows="False" DataSourceID="DSDiscussions">
        <Fields>
            <asp:BoundField DataField="Topic" HeaderText="Topic" SortExpression="Topic" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="DSDiscussions" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT [Topic] FROM [tblDiscussions]"></asp:SqlDataSource>
</fieldset>
<br />
<fieldset>
<legend>Contributions</legend>
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UProgress" runat="server" DisplayAfter="500">
    <ProgressTemplate>
        <img src="pix/ajax-loader.gif" alt="Please Wait..."/>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UPanel" runat="server">
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnSubmit" />
    </Triggers>
    <ContentTemplate>
    
    <asp:GridView ID="DGContribution" runat="server" AutoGenerateColumns="False" 
        DataSourceID="DSContribution">
        <Columns>
            <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
            <asp:BoundField DataField="Contribution" HeaderText="Contribution" 
                SortExpression="Contribution" />
            <asp:BoundField DataField="SubmittedDate" HeaderText="SubmittedDate" 
                SortExpression="SubmittedDate" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="DSContribution" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        
        
            SelectCommand="SELECT DISTINCT * FROM [QDiscussContrib] WHERE ([Discuss_fkid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Discuss_fkid" QueryStringField="ID" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    </ContentTemplate>
     </asp:UpdatePanel>
</fieldset>
<br />
    <fieldset>
    <legend>Tags</legend>
         <asp:CheckBoxList ID="cbListTag" runat="server" DataSourceID="DSDisTags" 
            DataTextField="Tag" DataValueField="ID" RepeatDirection="Horizontal">
        </asp:CheckBoxList>
        <asp:Label ID="lblTag" runat="server" Text="Add New Tag"></asp:Label><asp:TextBox
            ID="tbTag" runat="server"></asp:TextBox><br />
        <asp:SqlDataSource ID="DSDisTags" runat="server" 
            ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
            ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
            SelectCommand="SELECT * FROM [tblTagDiscussion]"></asp:SqlDataSource>
            <br />
        <asp:Button ID="btnTag" runat="server" Text="Tag Discussion" />
    </fieldset>
    <br />
      <form action="" class="input-frm" >
    <h1>Contribute to Discussion
        <span>Please fill all the texts in the fields.</span>
    </h1>
       
      <label>
        <span>Description :</span>
        <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" 
                ToolTip="Enter comment" Width="268px"></asp:TextBox>
    </label> 
   
     <label>
        <span>&nbsp;</span> 
        <asp:Button ID="btnSubmit" runat="server" Text="Add Comment" />
    </label>    
</form>
</asp:Content>

